<?php
Yii::app()->clientScript->registerCoreScript('jquery');?>



<style>
    .content-wrapper label {
        font-size: 35px;
    }

    .content-wrapper p {
        font-size: 28px;
    }

    a {
        text-decoration: none;
    }

    .pagination ul {
        list-style: none;
    }

    .pagination ul li {
        display: inline;
    }

    .pagination ul li a {
        padding: 10px;
    }

    .pagination ul li.active {
        text-decoration: underline;
    }

</style>

<div class="content-wrapper">

    <?php if (count($model) == 0)
        echo "Không tìm thấy rao vặt";
    else {
        ?>
        <div id="divPrint">
            <img alt="print" src="<?php echo HSUrl::home() . '/images/printer.png' ?>" title="Print">
            <label id="print">Print</label>
        </div>
        <?php
        $index = 0;
        foreach ($model as $k => $item) {
            ?>

            <div style="border-bottom: 2px solid gray;padding:0 20px;min-height: 235px;line-height: 30px">
                <div>
                    <label style="font-size: 53px;line-height: 60px;font-weight: bold">
                        <?php echo $item->name ?>
                    </label>

                    <div>
                        <label style="font-size: 25px;color:gray">Code: <?php echo $item->code ?></label>
                        <label style="font-size: 25px;color:gray"> | Danh
                            mục: <?php echo $item->category->name ?></label>
                    </div>
                </div>
                <p><?php echo $item->content ?></p>

            </div>

        <?php
        }?>

    <?php
    }
    ?>

</div>

<script type="text/javascript">
    $(document).ready(function () {
        $('#print').click(function () {
            var $print = $("#divPrint");
            var $pagination = $(".pagination");

            $print.attr('style', 'display:none');
            $pagination.attr('style', 'display:none');

            window.print();
            $print.attr('style', 'display:block');
            $pagination.attr('style', 'display:block');
            return false;
        });
    });
</script>